<!--file upload-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Static/Admin/css/bootstrap-fileupload.min.css" />
<!--body wrapper start-->
<div class="wrapper">
<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading">
            	添加新闻
            </header>
            <div class="panel-body">
                <div class="form">
                    <form class="cmxform form-horizontal adminex-form" id="signupForm" enctype="multipart/form-data" method="post" action="{:U('News/add')}">
                        <div class="form-group ">
                            <label for="firstname" class="control-label col-lg-2">新闻分类</label>
                            <div class="col-lg-10">
                                <select class="form-control m-bot15" name="cid">
                                <volist name="cat" id="vo">
                                <option value="{$vo.id}" style="colot:#ddd;">{$vo.name}</option>
                                <volist name="vo.child" id="child">
                                <option value="{$child.id}">&nbsp;&nbsp;{$child.name}</option>
                                </volist>
                                </volist>
                            	</select>
                            </div>
                        </div>
                        <div class="form-group ">
                            <label for="name" class="control-label col-lg-2">新闻标题</label>
                            <div class="col-lg-10">
                                <input class="form-control " value="" id="name" name="name" type="text" />
                            </div>
                        </div>
                        <div class="form-group ">
                            <label for="author" class="control-label col-lg-2">作者</label>
                            <div class="col-lg-10">
                                <input class="form-control " value="{$Think.session.USERNAME}" id="author" name="author" type="text" />
                            </div>
                        </div>
                       
                        <div class="form-group last">
								<label class="control-label col-lg-2" for="legal_id_img">新闻封面</label>
								<div class="col-md-9">
									<div class="fileupload fileupload-new" data-provides="fileupload">
										<div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
											<img src="{$service.legal_id_img}" alt="" />
										</div>
										<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
										<div>
											<span class="btn btn-default btn-file"> 
												<span class="fileupload-new"><i class="fa fa-paper-clip"></i>选择图片</span>
												<span class="fileupload-exists"><i class="fa fa-undo"></i>换一张</span>
												<input type="file" name="img" class="default" />
											</span>
											<a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload">
												<i class="fa fa-trash"></i>删除
											</a>
										</div>
									</div>
								</div>
						</div>
						<div class="form-group">
							<label for="author" class="control-label col-lg-2">内容</label>
                        	<div class="col-lg-10">
                            	<textarea class="form-control ckeditor" name="content" rows="6"></textarea>
                            </div>
                        </div>

						<div class="form-group">
                           <div class="col-lg-offset-2 col-lg-10">
                            <input type="hidden" name="submit" value="submit" />
                            <button class="btn btn-primary" type="submit">保存</button>
                           </div>
                        </div>
                    </form>
                </div>
            </div>
        </section>
    </div>
</div>
</div>
<!--body wrapper end-->
<!--file upload-->
<script type="text/javascript" src="__PUBLIC__/Static/Admin/js/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Static/Admin/js/ckeditor/ckeditor.js"></script>
<script>
	var uplodUrl = "{:U(\'News/ckeditorUplod\')}";
	CKEDITOR.replace( 'content', {
		filebrowserImageUploadUrl: uplodUrl,
		image_previewText: '',
		height:"500"
	});
</script>